﻿Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<WebService(Namespace:="http://www.resamu.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class logsurvey
    Inherits System.Web.Services.WebService

    <WebMethod()> _
     Public Function NewLog(ByVal idresamu As String, ByVal idteam As String, _
     ByVal idpers As String, ByVal operation As String, ByVal resultat As String) As String
        Dim dbLog As New LogDataSetTableAdapters.log_infoTableAdapter
        Dim message As String = System.Guid.NewGuid.ToString
        Try
            dbLog.Insert(message, Now, idresamu, idteam, idpers, operation, resultat)
            message = "LOGOK/" + message
        Catch ex As Exception
            message = "ERROR/" + ex.Message
        End Try
        Return message
    End Function
    <WebMethod()> _
    Public Function NbLog() As Int64
        Dim resultat As Int64
        Try
            Dim dbLog As New LogDataSetTableAdapters.log_infoTableAdapter
            Dim data As New LogDataSet.log_infoDataTable
            data = dbLog.GetData
            resultat = data.Rows.Count
        Catch ex As Exception
            resultat = -1
        End Try
        Return resultat
    End Function
    <WebMethod()> _
    Public Function ResetLog() As Integer
        Dim dbLog As New LogDataSetTableAdapters.log_infoTableAdapter
        dbLog.DeleteQueryALL()
    End Function

End Class
